 <?php
 //szczecin
  $lat=53.430606;
  $lng=14.556541;
  $zoom=12;
  $width=620;
  $height=680;
  $markerColor = array ("red","blue","yellow","purple","violet","black","pink","green","gray","lightgreen","turquoise","orange","darkgray", "lightblue","beige", "white", "brown","darkgreen" );

?>
Popularne kategorie:
<input type="button" id="btn16" onclick="reloadMap(16, true)" value="stacje beznynowe">
<input type="button" id="btn5" onclick="reloadMap(5, true)" value="bankomaty"><br>
 promień: <span id="range">3.10</span>km
 <input id="inr" value="3.10" type="hidden" >
 <!-- <input id="inr" disabled size="4" value="0.10" type="text" onchange="reloadMap(5, true)">km -->
 <div class="slider4">
   <div  class="indicator" id="indicator2">&nbsp;</div>
	<div class="indicator" id="indicator3">&nbsp;</div>
</div>
ilosc punktow:<input type="text" id="ini" onchange="reloadMap(5, true)" size="3" value="5">

<div id="map" class="dymek" style="width: <?php echo $width; ?>px; height: <?php echo $height; ?>px">
      </div>
 <div id="side_bar"></div>

      <script type="text/javascript">
      //<![CDATA[

var map;
var bounds;

// === Create an associative array of GIcons() ===
var gicons = [];
<?php
foreach($markerColor as $color)
{
   echo 'gicons["'.$color. '"] = new GIcon(G_DEFAULT_ICON, "images/markers/'.$color.'.png");'. PHP_EOL;
}
?>

initGMap();

 map.setCenter(new GLatLng(53.380043, 14.648995), 13);
 map.addControl(new GScaleControl() );
 // deklaracja ikonki numer jeden
 var ikona = new GIcon();
 ikona.image = "http://maps.google.com/mapfiles/kml/pal3/icon46.png";
 ikona.iconSize = new GSize(32, 32);
 ikona.iconAnchor = new GPoint(16,16);

var cross =  new GMarker(new GLatLng(53.380043,14.648995),{icon: ikona});
GLog.write('Dodano crossa');
map.addOverlay(cross);

   function readMap(url) {
        var url="external/find.php?"+url;
        
        var request = GXmlHttp.create();
        request.open("GET", url, true);
        request.onreadystatechange = function() {
          if (request.readyState == 4) {
             GLog.write('odczytano dane z pliku');
            var xmlDoc = request.responseXML;
            // obtain the array of markers and loop through it
            var markers = xmlDoc.documentElement.getElementsByTagName("marker");

            // hide the info window, otherwise it still stays open where the removed marker used to be
            map.getInfoWindow().hide();

            map.clearOverlays();

            // empty the array
            gmarkers = [];

            // reset the side_bar
            side_bar_html="";

            for (var i = 0; i < markers.length; i++) {
              // obtain the attribues of each marker
              var lat = parseFloat(markers[i].getAttribute("lat"));
              var lng = parseFloat(markers[i].getAttribute("lon"));
              var point = new GLatLng(lat,lng);
              var html = markers[i].getAttribute("name");
              var label = markers[i].getAttribute("desc");
              var dystans = markers[i].getAttribute("dystans");
              var ico = markers[i].getAttribute("ico");
              // create the marker
              var marker = addMarkerAndExtendedDesc(point,label,html, label, dystans, ico);
              map.addOverlay(marker);
            }
            GLog.write('Dodano '+markers.length+' markerow');
            // put the assembled side_bar_html contents into the side_bar div
           document.getElementById("side_bar").innerHTML = side_bar_html;
           map.addOverlay(cross);
          }

        }
        request.send(null);
      }

GEvent.addListener(map,'moveend',this.reloadMap);

readMap('lon=14.658&lat=53.383&r=5&i=6');

      //]]>
      </script>